package com.example.demo.Controller;

import com.example.demo.Master.MasterBase;
import com.example.demo.Service.RecycleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;

@RestController
@RequestMapping("/Recycle")
public class RecycleController {
    @Autowired
    private RecycleService recycleService;

    //显示回收站文件
    @RequestMapping("/showRecycleFiles")
    public ArrayList showRecycleFiles(String userName,MasterBase masterBase){
        ArrayList list = recycleService.showRecycleFiles(userName,masterBase);
        return list;
    }

    //文件恢复
    @RequestMapping("/restoreFSFiles")
    public void restoreFSFile(String userName,MasterBase masterBase,String filePath,String fileName){
        recycleService.restoreFSFile(userName,masterBase,filePath,fileName);
    }

    //彻底删除文件
    @RequestMapping("/destroyFile")
    public void destroyFile(String userName,MasterBase masterBase,String filePath,String fileName){
        recycleService.destroyFile(userName,masterBase,filePath,fileName);
    }
}
